package com.duxiaolie.demobook.mapper;

import com.duxiaolie.demobook.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description: TODO
 *
 * @author: WeiYingYu
 * @date:2020/10/18
 */
@Mapper
public interface UserMapper {
    /**
     * 查询所有用户
     * @return
     */
    @Select("select id,username,address from tb_user")
    List<User> getAllUser();

    /**
     * 删除用户
     * @param id
     */
    @Delete("DELETE FROM tb_user WHERE id=#{id}")
    void del(Integer id);
}
